<?php

namespace App\Models;

class OrderItem extends Model
{
    protected $table = 'order_items';

    protected $fillable = ['name', 'email'];

    // ============= scope ==========
    public function scopeOfUserPaid($query, $userId)
    {
        return $query->where('user_id', $userId)->where('status', Order::ORDER_STATUS['paid']);
    }

    // ============= relations ==========




    // ============= field ==========
    public function getOderId()
    {
        return $this->order_id;
    }

    public function setOrderId($oderId)
    {
        $this->order_id = $oderId;
    }

    public function setQuantity($quantity)
    {
        $this->quantity = $quantity;
    }

    public function setUserId($userId)
    {
        $this->user_id = $userId;
    }

    public function getCourseId()
    {
        return $this->course_id;
    }

    public function setCourseId($courseId)
    {
        $this->course_id = $courseId;
    }

    public function getLevel()
    {
        return $this->level;
    }

    public function setLevel($level)
    {
        $this->level = $level;
    }

    public function setPrice($price)
    {
        $this->price = $price;
    }

    public function setDiscountPrice($price)
    {
        $this->discount_price = $price;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function setStatus($status)
    {
        $this->status = $status;
    }
}
